
package pos.storage.db;

import pos.interfaces.Database;
import pos.interfaces.Storage;
import pos.storage.db.mysql.MySQL;

/**
 * Factory class to create specific Database objects. This uses Factory Method design patter
 * @author srikanth ramu
 */
public abstract class DBFactory implements Database {

    /**
	 * Instantiates the implementing class based on a condition
	 * @param type
	 * @return
	 */
	public static Storage getDatabase(String type){
                //Creates MySQL object
		if(type.equals(Database.MYSQL)){
                        Storage mysqlstorage = MySQL.getInstance();
			return mysqlstorage;
		}
		return null;
	}
}
